package com.yufei.ui.utils;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;

public class ComponentUtils {
//居中显示
	public static void centerComponent(Component conComponent){
		
		int width = (Toolkit.getDefaultToolkit().getScreenSize().width) / 2;
		int height = (Toolkit.getDefaultToolkit().getScreenSize().height) / 2;
		conComponent.setLocation(width, height);
		conComponent.setPreferredSize(new Dimension(width, height));
		
	}
}
